@(spurnSvor: List[models.domain.QuestionAndAnswers], vidhengi: List[models.data.Vidhengitafla], heiti: String)
@teacherMain(title = "Verkefni") {

    <div class="container">
        <div class="span9">
            <h3>@{heiti}</h3>
            @if(spurnSvor == null){
                <p>Engar spurningar eru skráðar í þetta verkefni.</p>
            }
            @if(spurnSvor != null){
                @for((spurn,i) <- spurnSvor.zipWithIndex){
                    <h5>Spurning @(i+1) - @{spurn.getVaegi}%</h5>
                    <div class="well">
                        @if(spurn.getTegund == "texti"){
                            <p> @{spurn.getTexti}</p>
                            <p><input class ="input-xxlarge" disabled></p>
                        }
                        @if(spurn.getTegund == "eydufylling"){
                            <p>@{spurn.getTexti} <p>
                                @for((eydufylling,i) <- spurn.getEydufyllingar.zipWithIndex){
                                    @{eydufylling}
                                    @if(i != spurn.getEydufyllingar.size()-1){
                                        <input class="input-large" disabled="">
                                    }
                                }
                                }
                        @if(spurn.getTegund == "mynd"){
                            <p>@{spurn.getTexti}</p>
                            <figure><img src="data:image/png;base64,@{spurn.getVidhengi}"></figure>
                            <textarea class="input-xxlarge" disabled='disabled'> </textarea>
                        }
                        @if(spurn.getTegund =="krossar"){
                            <p>@{spurn.getTexti}</p>
                            @for((krossasvor,j) <- spurn.getSvor.zipWithIndex){
                                @if(spurn.getSvorID.get(j) == spurn.getRettSvar){
                                    <p class="boldLine"><input type="radio" disabled> @{krossasvor}</p>
                                }else{
                                    <p><input type="radio" disabled> @{krossasvor}</p>
                                }
                            }
                        }
                        @if(spurn.getTegund == "fjolval"){
                            <p>@{spurn.getTexti}</p>
                            @for((fjolvalsvor,j) <- spurn.getSvor.zipWithIndex){
                                @if(spurn.getRettSvor.get(j) == 1){
                                    <p class="boldLine"><input type="checkbox" disabled> @{fjolvalsvor}</p>
                                }else{
                                    <p><input type="checkbox" disabled> @{fjolvalsvor}</p>
                                }
                            }
                        }

                    </div>
                }
            }
            @if(vidhengi != null){
                <h5>Viðhengi</h5>
                <table class="table table-striped">
                    @for(vidh <- vidhengi){
                        <tr>
                            @helper.form(action = routes.CommonController.download(vidh.getSpurning_id),'enctype -> "multipart/form-data", 'class -> "form-horizontal") {
                                <form method="get">
                                    <td><button type="submit" class="btn btn-primary btn-mini">
                                        <i class="icon-download-alt"></i>
                                    </button>
                                        @{vidh.getNafn} </td>
                                </form>
                            }
                            @if(vidh.getContenttype=="application/pdf"){
                                @helper.form(action= routes.CommonController.openPdfInBrowser(vidh.getSpurning_id),'enctype -> "multipart/form-data", 'class -> "form-horizontal"){
                                    <td> <button type="submit" title="Opna skjalið í vafra" class="btn btn-primary btn-small">
                                        <i class="icon-globe"></i>  Opna í vafra
                                    </button></td>
                                }
                            }else{
                                <td> &nbsp;</td>
                            }
                        </tr>
                    }
                </table>
            }
        </div>
    </div>
}